//
//  LFVideoEncoding.h
//  YMDemo
//
//  Created by admin on 2022/2/25.
//

#import <Foundation/Foundation.h>
#import "YMVideoFrame.h"
#import "YMLiveVideoConfiguration.h"

@protocol YMVideoEncoding;
/// 编码器编码后回调
@protocol YMVideoEncodingDelegate <NSObject>
@required
- (void)videoEncoder:(nullable id<YMVideoEncoding>)encoder videoFrame:(nullable YMVideoFrame *)frame;
@end

/// 编码器抽象的接口
@protocol YMVideoEncoding <NSObject>
@required
- (void)encodeVideoData:(nullable CVPixelBufferRef)pixelBuffer timeStamp:(uint64_t)timeStamp;
@optional
@property (nonatomic, assign) NSInteger videoBitRate;
- (nullable instancetype)initWithVideoStreamConfiguration:(nullable YMLiveVideoConfiguration *)configuration;
- (void)setDelegate:(nullable id<YMVideoEncodingDelegate>)delegate;
- (void)stopEncoder;
@end

